<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>scipad</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : 05/09/2005</div>
    <p>
      <b>scipad</b> - Embedded Scilab text
  editor</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>scipad()</tt>
      </dd>
      <dd>
        <tt>scipad(f)</tt>
      </dd>
      <dd>
        <tt>scipad([f1,f2,...])</tt>
      </dd>
      <dd>
        <tt>scipad f1 f2 ...</tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>f, f1, f2...</b>
        </tt>: file pathnames</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>Scipad is an embedded Scilab text editor written in TCL/TK. It can be
    started with the "Editor" button on top of the main Scilab window, or from
    Scilab command line with the instruction <tt>
        <b>scipad()</b>
      </tt> or
    <tt>
        <b>scipad f</b>
      </tt>.</p>
    <p>The same invocation adds further files to an already opened scipad
    session. Scipad allows Windows like edition modes. Keyboard shortcuts are
    defined for most possible editing actions and reported by the menu
    entries.</p>
    <p>Additionally, the following shortcuts are defined:</p>
    <div align="center">
      <table border="2">
        <tr align="center">
          <td>&lt;F2&gt;</td>
          <td>Save file</td>
        </tr>
        <tr align="center">
          <td>&lt;F5&gt;</td>
          <td>Save file and run it into Scilab</td>
        </tr>
        <tr align="center">
          <td>&lt;F6&gt;, &lt;Control-F6&gt;</td>
          <td>Show next buffer</td>
        </tr>
        <tr align="center">
          <td>&lt;F7&gt;, &lt;Control-F7&gt;</td>
          <td>Show previous buffer</td>
        </tr>
        <tr align="center">
          <td>&lt;double-click
        mouse-button1&gt;</td>
          <td>Select word</td>
        </tr>
        <tr align="center">
          <td>&lt;triple-click
        mouse-button1&gt;</td>
          <td>Select line</td>
        </tr>
        <tr align="center">
          <td>&lt;Shift-Control-mouse-button1&gt;</td>
          <td>Open the source of the library function under the
        pointer</td>
        </tr>
        <tr align="center">
          <td>&lt;mouse-button2&gt;</td>
          <td>Paste selection</td>
        </tr>
        <tr align="center">
          <td>&lt;mouse-button3&gt;</td>
          <td>Popup edit menu, or debug menu if clicked during a
        debug session</td>
        </tr>
        <tr align="center">
          <td>&lt;Shift-mouse-button3&gt;</td>
          <td>Popup Execute menu</td>
        </tr>
        <tr align="center">
          <td>&lt;Control-mouse-button3&gt;</td>
          <td>Popup Options menu</td>
        </tr>
        <tr align="center">
          <td>&lt;Control-plus&gt;</td>
          <td>Increase the font size</td>
        </tr>
        <tr align="center">
          <td>&lt;Control-minus&gt;</td>
          <td>Decrease the font size</td>
        </tr>
        <tr align="center">
          <td>&lt;double-button1&gt; on a tile
        title</td>
          <td>Maximize this tile</td>
        </tr>
        <tr align="center">
          <td>&lt;double-button1&gt; on a sash</td>
          <td>Space sashes evenly (for this paned
        window)</td>
        </tr>
        <tr align="center">
          <td>&lt;button2&gt; on a tile title</td>
          <td>Switch hidden files</td>
        </tr>
      </table>
    </div>
    <p>The "Load Into Scilab" (Ctrl-lowercase-l) menu entry can be used to
    <a href="../programming/exec.htm">
        <tt>
          <b>exec</b>
        </tt>
      </a> the file content into Scilab, while "Execute selection"
    (Ctrl-lowercase-y) passes the selected lines to the scilab shell using
    <a href="../tksci/ScilabEval.htm">
        <tt>
          <b>ScilabEval</b>
        </tt>
      </a> (i.e. <a href="../programming/execstr.htm">
        <tt>
          <b>execstr</b>
        </tt>
      </a>).</p>
    <p></p>
    <h3>
      <font color="blue">Debugger</font>
    </h3>
    <dl>
      <p>Scipad 2.0 or later includes a debugger (for .sci files only). The user
    can:</p>
      <p></p>
      <dd>
        <li>
          <b>
            <font color="maroon">Set/remove breakpoints anywhere in the opened files.</font>
          </b>The breakpointed lines get pink background.<p></p>
        </li>
        <li>
          <b>
            <font color="maroon">Configure execution.</font>
          </b>The user has to provide the function name to execute, its variable
        names, and variable values. To ease this step, a scan of the currently
        displayed buffer is implemented to look for functions defined in it,
        scan their names and variable names. All this is displayed to the user
        in a dialog for easy selection. First, he has to select a function in
        a spinbox, then eventually one of its variables. Once a variable is
        selected, the user can set/change its value (another dialog pops).
        Variable values and names are displayed in listboxes. The user can
        also add a new variable or remove already defined variables. This is
        in case the user changes the input variables of his function in the
        file, and he does not want to scan the buffer again (which causes all
        the variable values to reset to a null value, actually "").<p></p>
        </li>
        <li>
          <b>
            <font color="maroon">Launch execution with breakpoints.</font>
          </b>Scipad execs the currently displayed buffer as well as all the
        opened buffers that contain functions, sends to Scilab the buffer as
        well as all the opened buffers that contain functions, sends to Scilab
        the setbpt instructions relative to all the breakpoints that have been
        set, and executes the selected function with the input variable values
        provided during the configure execution step. Then the execution is
        automagically stopped by Scilab at the first breakpoint.<p></p>
        </li>
      </dd>
      <p>At this point there are several possibilities for the user:</p>
      <p></p>
      <dd>
        <li>
          <b>
            <font color="maroon">Continue up to next breakpoint.</font>
          </b>Scilab resumes execution, and stops at the next breakpoint or goes
        to the end of the file if there are no more breakpoints. The active
        breakpoint is emphasized in Scipad so that it can easily be
        identified.<p></p>
        </li>
        <li>
          <b>
            <font color="maroon">Insert a new breakpoint or remove existing breakpoint during the debug.</font>
          </b>The breakpointed lines get pink background, and lines where
        breakpoints are removed restore their normal background. The new
        breakpoint configuration is taken into account for the next steps of
        execution or debug.<p></p>
        </li>
        <li>
          <b>
            <font color="maroon">Execute step by step.</font>
          </b>This is currently not available (it is always disabled in the
        Debug menu). See proc stepbystep_bp in
        SCI/tcl/scipadsources/db_debugsession.tcl for further details about
        the problems encountered for this item.<p></p>
        </li>
        <li>
          <b>
            <font color="maroon">Continue ignoring any breakpoint.</font>
          </b>Finish execution in Scilab as if there was no breakpoint at all:
        Breakpoints are removed from Scilab but kept in Scipad.<p></p>
        </li>
        <li>
          <b>
            <font color="maroon">Abort debug.</font>
          </b>Abort execution in Scilab and cancel the current debug session in
        Scipad.<p></p>
        </li>
        <li>
          <b>
            <font color="maroon">Remove all breakpoints.</font>
          </b>This allows to quickly remove all the breakpoints from both Scilab
        and Scipad.<p></p>
        </li>
      </dd>
      <p>At any time during the debug, a <b>watch window</b> can be displayed
    on user request. It allows to monitor any variable value, or change a
    variable value during a breakpoint stop and relaunch execution with the
    modified value. The watch window also displays the calling stack.</p>
      <p>After the end of the execution, the breakpoints are removed from Scilab
    (but kept in Scipad).</p>
      <p></p>
      <p>In its current development state the debugger works well with
    functions, i.e. <b>pure .sci files</b>. Support of .sce files or mixed
    .sce/.sci files has been foreseen but not yet implemented. That means that
    a .sce file will not crash Scipad, which is the very least, but more, once
    a feasible solution for debugging this type of files is figured out, it
    should be easy to add the functionality in the Scipad source code. Anyway,
    if actually a debug is required in a .sce, you should first convert it
    into a .sci function just by adding (output_vars)=function foo(input_vars)
    / endfunction and that's it. The absence of breakpoints management for
    .sce is therefore not such a major drawback.</p>
      <p></p>
    </dl>
    <h3>
      <font color="blue">Remarks</font>
    </h3>
    <dl>
      <dd>
        <li>
          <b>
            <font color="maroon">Localisation:</font>
          </b>Scipad menues and messages can be translated to several languages.
        By default, they appear in the language of Scilab, which is either
        English or French (see <a href="setlanguage.htm">
            <tt>
              <b>setlanguage</b>
            </tt>
          </a>), but other languages
        are being added. The localization in effect can be selected with the
        menu Options/Locale, and is remembered across sessions. Currently, the
        supported languages are: "de" (German) ,"eng" (English), "fr"
        (French), "it" (Italian), "no" (Norwegian), "se" (Swedish).Further languages can be added by creating the proper translation
        file and putting it in SCI/tcl/scipadsources/msg_files/. If you plan
        to do such a job, please check the file
        <tt>
            <b>SCI/tcl/scipadsources/msg_files/AddingTranslations.txt</b>
          </tt>
        for detailed instructions, and consider to contribute it to the
        community.<p></p>
        </li>
        <li>
          <b>
            <font color="maroon">Drag and drop:</font>
          </b>DnD has been implemented in Scipad for moving around text, for
        dropping selected text from and to external applications, and for
        opening files or for list of files.<p>Dragging one or more files from an explorer and dropping to Scipad
        will open the file(s) in Scipad. Doing the same with a directory will
        open recursively all the directory contents (beware!)</p>
          <p>For text selected within the Scipad window, the possible actions
        are move (just use mouse button-1) and copy (Control button-1). Text
        selections can be moved or copied also between different Scipad
        subpanes, when tiling is active.</p>
          <p>Drag and drop capabilities in Scipad rely on the TkDnD package
        (http://sourceforge.net/projects/tkdnd). Presence of this package
        should be automatically detected by Scipad, enabling the corresponding
        features at that time. Windows and linux-i386 binary versions of
        Scilab are currently shipped with Tkdnd. If not, here are some
        installation instructions:</p>
          <p>Windows platforms: Download the full package (currently
        tkdnd-1.0a2.tar.gz), and uncompress it somewhere. Copy the content of
        lib\tkdnd and paste it into SCI\tcl\tk8.4\tkdnd. That's all!</p>
          <p>linux-i386 platforms: Download the rpm package (currently
        tkdnd-1.0-b2.i386.rpm). Install it with rpm -U (may have to force
        --nodeps if it doesn't recognize an existing tcl installation). If you
        have a source version of Scilab and an installation of tcl-tk, check
        where they are installed (e.g. /usr/share/) and move the newly created
        directory /usr/lib/tkdnd1.0/ to there. If you have a binary version of
        Scilab, move tkdnd1.0/ to SCI/tcl/, where the supplied tcl-tk binaries
        are.</p>
          <p></p>
        </li>
        <li>
          <b>
            <font color="maroon">Known Issues:</font>
          </b>
          <p></p>The commands passed are output on the Scilab window, but are not
        recorded in the history.<p></p>
        </li>
        <li>
          <b>
            <font color="maroon">Bugs:</font>
          </b>There are still a few... Details can be found in file
        SCI/tcl/scipadsources/BUGS<p></p>
        </li>
      </dd>
    </dl>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>
   scipad SCI/scilab.star 
</pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="../functions/edit.htm">
        <tt>
          <b>edit</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../fileio/manedit.htm">
        <tt>
          <b>manedit</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="edit_error.htm">
        <tt>
          <b>edit_error</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
    <h3>
      <font color="blue">Authors</font>
    </h3>
    <dl>
      <dd>
        <b></b>Scipad is derived from <tt>
          <b>tknotepad</b>
        </tt> written by
    Joseph Acosta;</dd>
      <dd>
        <b></b>Mathieu Philippe, INRIA, 2001;</dd>
      <dd>
        <b></b>Enrico Segre, Weizmann Institute, 2003-2005;</dd>
      <dd>
        <b></b>Francois Vogel, 2004-2005.</dd>
    </dl>
  </body>
</html>
